package com.scu.qingshi.infrastructure.dao.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.scu.qingshi.infrastructure.dao.po.Node;
import com.scu.qingshi.infrastructure.dao.mapper.NodeMapper;
import com.scu.qingshi.infrastructure.dao.service.NodeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 青时
 * @since 2022-03-05
 */
@Service
public class NodeServiceImpl extends ServiceImpl<NodeMapper, Node> implements NodeService {

    @Override
    public Integer insertAndReturnId(Node node) {
        return baseMapper.insertAndReturnId(node);
    }

    @Override
    public void iUpdate(Node node) {
        UpdateWrapper<Node> wrapper = new UpdateWrapper<>();
        wrapper.eq("node_id",node.getNodeId());
        this.baseMapper.update(node,wrapper);
    }
}
